const defaultState = {
  banner_list: [], //轮播图
  imgHeight: 170, //轮播图高度
  nav_list: [],   //导航列表
  product_list: [],  //商品图片列表
  category_list:[],  //分类列表数据
  category_rightContent:[],  //右边渲染的数据
}
export default (state = defaultState, action) => {
  let newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case 'GET_BANNER':
      newState.banner_list = action.payload.banner_list
      break;
    case 'GET_CATITEMS':
      newState.nav_list = action.payload.nav_list
      break;
    case 'GET_FLOORDATA':
      newState.product_list = action.payload.product_list
      break;
    case 'GET_CATEGORYINFO':
      newState.category_list = action.payload.category_list
      newState.category_rightContent = action.payload.category_rightContent
      break;
    default:
      break;
  }
  return newState
}